//
//  testIsGameOver.c
//  dominion
//
//  Created by Doug Mason on 3/8/14.
//  Copyright (c) 2014 Doug Mason. All rights reserved.
//

#include <stdio.h>
#include "testIsGameOver.h"
int isGameOver(struct gameState* state){
    int numErrors = 0;
    
    int i, j=0;
    int gameOverResult = isGameOver(state);
    if( state->supplyCount[province] == 0){
        if(gameOverResult !=1){
            printf("Failed test for when province cards are no longer in the game\n");
            numErrors+=1;
        }
        else{
            return 1;
        }
    }
    for (i=0; i<25; i++) {
        if (state->supplyCount[i]==0) {
            j++;
        }
    }
    if(j>=3){
        if (gameOverResult!=1) {
            printf("failed test for supply count exhausting \n");
            numErrors+=1;
        }
        else{
            return 1;
        }
    }
    
    if(numErrors == 0 && gameOverResult !=1){
        printf("All tests passed for isGameOver()");
        return 0;
    }
    else{
        printf("Number of tests failed: %d\n",numErrors);
        return 1;
    }
}